<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>列表页</title>
<link rel="stylesheet" type="text/css" href="http://localhost/cms/Template/style/css/base.css" />
<link rel="stylesheet" type="text/css" href="http://localhost/cms/Template/style/css/listPage.css" />
</head>

<body>
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div class="top w980 bc clearfix">
	<img src="http://localhost/cms/Template/style/images/index_02.jpg" class="fl" />
    <div class="fr topbox">
        <!-- 
        <a href="">
            <img src="http://localhost/cms/Template/style/images/index_05.jpg" />
            常见问题
        </a>
        <a href="">
            <img src="http://localhost/cms/Template/style/images/index_07.jpg" />
            人才招聘
        </a>
        <a href="">
            <img src="http://localhost/cms/Template/style/images/index_09.jpg" />
            下载专区
        </a>
         -->
    </div>
</div>
<div class="nav w">
	<ul class="w980 bc navlist">
    	<li <?php if(!Q('get.cid')){?>class="thisClass"<?php }?>>
            <a href="http://localhost/cms/index.html">网址首页</a>
        </li>
        <?php $cate = K('Category')->where('is_show=1 and is_nav=1')->limit()->order('csort DESC')->all(); ?>
<?php if(is_array($cate)):?><?php  foreach($cate as $field){ ?>
<?php 
$field['curl'] = get_cate_url($field['is_listhtml'],$field['htmldir'],$field['cid']);
$field['class'] = $field['cid'] == Q('get.cid') ? thisClass : '';
?>

            <li class="<?php echo $field['class'];?>">
                <a href="<?php echo $field['curl'];?>"><?php echo $field['cname'];?></a>
            </li>
        
<?php }?><?php endif;?>
    </ul>
</div>
<div class="bg w">
	<img src="http://localhost/cms/Template/style/images/list_03.jpg" class="bc mt10" />
	<div class="w960 bc mt10 clearfix main p10">
    	<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div class="left-con fl">
	<p class="mt5">标签</p>
	<div class="tag clearfix">
		<?php
	$tag = K('Tag') -> in(array()) -> all();
?>	
<?php if(is_array($tag)):?><?php  foreach($tag as $field){ ?>
<?php
$field['url'] = U('List/index',array('tid'=>$field['tid']));

$field['class'] = $field['tid'] == Q('get.tid') ? thisClass : '';
?>
	
			<a href="<?php echo $field['url'];?>" class="<?php echo $field['class'];?>"><?php echo $field['tagname'];?></a>
		
<?php }?><?php endif;?>		
	</div>
</div>
        <div class="riht-con fr">
        	   <h1 class="mt5">
                    <?php if(Q('get.tid')){?>
                      [<?php echo $tagstr;?>]
                    <?php  }else{ ?>
                        <?php $cate = K('Category')->where('is_show=1')->limit()->order('csort DESC')->all(); ?>
<?php if(is_array($cate)):?><?php  foreach($cate as $field){ ?>
<?php 
$field['curl'] = get_cate_url($field['is_listhtml'],$field['htmldir'],$field['cid']);
$field['class'] = $field['cid'] == Q('get.cid') ?  : '';
?>
[<?php echo $field['cname'];?>]&nbsp;&nbsp;
<?php }?><?php endif;?>
                    <?php }?>
               </h1>
            <?php 
if(3){
		if(isset($_GET['cid'])){
			$cateInfo = K('Category')->where(array('cid'=>$_GET['cid']))->field('is_listhtml,htmldir')->find();
			if($cateInfo['is_listhtml']){
				//如果是静态则处理静态地址
				Page::$staticUrl = 'http://localhost/cms/Static/'.$cateInfo['htmldir'].'/index_{page}.html';
			}
	}
	
	$arcTotal = K('ArticleCateView')->where('is_recycle=0 and aid in (82,89,87,88,90)')->count();
	$pageObj = new Page($arcTotal,2,3);
	//如果存在cid则处理静态地址
	$page = $pageObj->show();
	$arc = K('ArticleCateView')->where('is_recycle=0 and aid in (82,89,87,88,90)')->limit()->all($pageObj->limit());
}else{
	$arc = K('ArticleCateView')->where('is_recycle=0 and aid in (82,89,87,88,90)')->limit()->all();
}

?>
<?php if(is_array($arc)):?><?php  foreach($arc as $field){ ?>
<?php 
	$field['url'] = get_arc_url($field['is_archtml'],$field['htmldir'],$field['aid']);
	if(0) $field['title'] = mb_substr($field['title'], 0,0,'utf-8');
	$field['thumb'] = 'http://localhost/cms/' . $field['thumb'];
	$field['time'] = date('y-m-d',$field['sendtime']);
	$field['total'] = K('Comment')->get_total($field['aid']);
?>

            <div class="clearfix mt10">
            	<img src="<?php echo $field['thumb'];?>" class="fl" width="210" height="140" />
                <div class="fr box-con">
                	<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?></a></h2>
                    <p class="t2 lh25">
                    <?php echo $field['digest'];?>
                    </p>
                </div>
            </div>
            
<?php }?><?php endif;?>

            <div class="page clearfix mt10">
                <?php echo $page;?>
            </div>
        </div>
    </div>
</div>
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div class="bottm w">
	<div class="w980 bc box pt10">
    	<p class="tc lh30">
        	<?php echo C("copy");?>
        </p>
    </div>
</div>
</body>
</html>
